{extend name="public/base" /} {block name="body"}
<div class="content-tabs">
	<ol class="breadcrumb">
		<li>
			<a href="{:url('index/index')}"><i class="fa fa-home"></i></a>
		</li>
		<li><strong>线下会员列表</strong></li>
	</ol>
</div>
<div class="ibox float-e-margins" >
	<div class="ibox-content">
		<form id="myForm" class="form-horizontal m-t" method="post" action="{:url('index')}">	
			<a href="{:url('export')}" class="btn btn-primary btn-outline">导出会员信息</a></span>
			<div class="form-group" style="padding-left: 20px">           	
				商家名称 <input type="text" id="store_name" name="store_name" value="" placeholder="请输入商家名称" class="bank" />
        		会员卡号 <input type="text" id="memberNo" name="memberNo" value="" placeholder="请输入会员卡号" class="bank" />
				姓名 <input type="text" id="membername" name="membername" value="" placeholder="请输入姓名" class="bank" />
	     		手机号 <input type="text" id="mobile" name="mobile" value="" placeholder="请输入手机号" class="bank" />
	     		有效期 <input id='start_time' name='start_time'  style="width: 160px;" onclick='WdatePicker()' type='text' placeholder="开始时间" class="bank" />	
				至<input id='end_time' name='end_time'  style="width: 160px;" onclick='WdatePicker()' type='text' placeholder="结束时间" class="bank" />
				<span class="bank"><button type="submit" class="btn btn-sm btn-primary"><li class="fa fa-search"> 查询</li></button> </span>				
			</div>			
		</from>
		<div class="hr-line-dashed"></div>
		<div class="example-wrap">
			<div class="example">
				<form method="post" action="{:url('index')}">
					<table class="table table-bordered table-hover">
						<thead>
							 <tr class="long-tr">   
                            	<th>卡号</th>
                                <th>姓名</th>
                                <th>手机号</th>
                                <th>等级</th>
								<th>积分</th>
								<th>余额</th>
								<th>状态</th>
								<th>有效期</th>
                                <th>注册时间</th>
                                <th>所属店铺</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody id="list">
                        	{volist name="list" id='ad'}
                        	<tr>
                        		<td>{$ad.memberNo}</td>
                        		<td>{$ad.membername}</td>
                        		<td>{$ad.mobile}</td>
                        		<td>
                        			{if $ad.memberGradeId == 0}
                        			会员默认等级
                        			{else}
                        			一级
                        			{/if}
                        		</td>
								<td>{$ad.total_score}</td>
                        		<td>{$ad.newblanceflg}</td>
                        		<td>
                        			{if $ad.status == 1}
                        			正常
                        			{else}
                        			异常
                        			{/if}
                        		</td>
                        		<td>
                        			{if $ad.validity_date == ''}
                        			永久有效
                        			{else}
                        			{$ad.validity_date}
                        			{/if}
                        		</td>
                        		<td>{$ad.reg_date}</td>
                        		<td>{$ad.store_name}</td>
								<td class="text-center">
									<input type="button" value="增积分" id="jifen"class="btn btn-primary bnt-sm"onclick="edit({$ad.id})">
									<input type="button" value="减积分" id="jifen"class="btn btn-danger bnt-sm"onclick="edit2({$ad.id})">
								</td>
							</tr>
							{/volist}
						</tbody>
					</table>
					<div style="text-align: right;">
                      {$list->render()}
                    </div>
				</form>
			</div>
		</div>
	</div>
	</div>
</div>
<script src="__LIB__/datepicker/WdatePicker.js"></script>
<script>
	
	function edit(id){
		var tel=parent.layer.prompt({title: '输入增加的积分',formType: 0}, 
	    function(integral){layer.open({content: '确认添加的积分为'+integral+'？',
					btn: ['确认', '取消'],yes: function(index, layero) {window.location.href='integral/id/'+id+'/integral/'+integral;},
													btn2: function(index,layero) {},
						                        cancel: function() {
						                            //右上角关闭回调  
						                      }
				});
			});
		
	}
	function edit2(id){
		var tel=parent.layer.prompt({title: '输入减少的积分',formType: 0}, 
	    function(integral){layer.open({content: '确认减少的积分为'+integral+'？',
					btn: ['确认', '取消'],yes: function(index, layero) {window.location.href='integral2/id/'+id+'/integral/'+integral;},
													btn2: function(index,layero) {},
						                        cancel: function() {
						                            //右上角关闭回调  
						                      }
				});
		});
	}

	</script>
{/block} {block name="script"}

<style>
	
.bank{
	width: 150px;
    height:30px;
    text-align:center;
    border-radius:5px;
}
</style>
{/block}